package com.aqiang.day0528_shop.main.view.view

import android.content.Context
import android.graphics.Canvas
import android.graphics.drawable.Drawable
import android.support.v4.content.ContextCompat
import android.support.v7.widget.AppCompatEditText
import android.util.AttributeSet
import com.aqiang.day0528_shop.R

class MEditView @JvmOverloads constructor(var con:Context, var attrs:AttributeSet) : AppCompatEditText(con,attrs) {
    private var leftDraw:Drawable
    private var rightDraw:Drawable
    init {
        leftDraw = ContextCompat.getDrawable(context, R.drawable.ic_action_update)!!
        leftDraw.setBounds(0,0,50,50)
        rightDraw = ContextCompat.getDrawable(context, R.drawable.ic_action_del)!!
        rightDraw.setBounds(0,0,50,50)
        setCompoundDrawables(leftDraw,null,rightDraw,null)
    }

    override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec)
    }

    override fun onDraw(canvas: Canvas?) {
        super.onDraw(canvas)
    }
}